
import request from '@/utils/request'
/**
 * 获取员工列表
 * @param {Object} query 查询参数 { page: 1, size: 5 }
 * @returns Promise
 */
export const getEmployeeListAPI = (query) => {
  return request({
    method: 'get',
    url: '/sys/user',
    params: query
  })
}

/**
 * 删除员工
 * @param {String} Id 员工Id
 * @returns Promise
 */
export const delEmployeeAPI = (Id) => {
  return request({
    method: 'delete',
    url: `/sys/user/@{Id}`
  })
}
/**
 * 获取员工列表
 * @param {Object} query 查询参数 { page: 1, size: 5 }
 * @returns Promise
 */
export const addEmployeeAPI = (employeeFrom) => {
  return request({
    method: 'post',
    url: '/sys/user',
    data: employeeFrom
  })
}

export const addEmployeeBatchAPI = (employeeList) => {
  return request({
    method: 'post',
    url: '/sys/user/batch',
    data: employeeList
  })
}

export const getEmployeeInfoAPI = (employeeId) => {
  return request({
    method: 'get',
    url: `/sys/user/${employeeId}`
  })
}
export const updateEmployeeAPI = (employeeFrom) => {
  return request({
    method: 'put',
    url: `/sys/user/${employeeFrom.id}`,
    data: employeeFrom
  })
}
